﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NeuralStock.DataAccess;

namespace NeuralStock.DomainService.Interfaces
{
    public interface ICompanyQuotationService
    {
        bool QuotationExists(int companyId, DateTime date);

        bool QuotationsExist(int companyId, int yearFrom, int yearTo);

        void CreateQuotation(int companyId, DateTime date, decimal price);

        void UpdateQuotation(int companyId, DateTime date, decimal price);

        #region Get

        CompanyQuotation Get(int companyId, DateTime date);

        IEnumerable<CompanyQuotation> GetQuotationsForYears(int companyId, int yearFrom, int yearTo);

        decimal GetMaxReturnForCompany(int companyId, int yearFrom, int yearTo);

        decimal GetMaxReturnForCompanyStartingAfterFirstQuarter(int companyId, int yearFrom, int yearTo);

        decimal GetReturnAfterWholePeriodStartingAfterFirstQuarter(int companyId, int yearFrom, int yearTo);

        int? GetDaysForAchievingReturnStartingAfterFirstQuarter(int companyId, int yearFrom, int yearTo, decimal expectedReturn);

        decimal? GetMinPriceForYear(int companyId, int year);

        decimal? GetAvgPriceForYear(int companyId, int year);

        CompanyQuotation GetQuoteAfterFirstQuarter(int companyId, int year);

        DateTime GetFirstQuotationDate(int companyId);

        List<CompanyQuotation> GetQuotesStartingAfterFirstQuarter(int companyId, int yearFrom, int yearTo);

        decimal GetLastPrice(int companyId);

        #endregion
    }
}
